#if !defined(AFX_SYSTEMCONFIG_H__3BF581A8_056E_40BC_99F7_271283243DD7__INCLUDED_)
#define AFX_SYSTEMCONFIG_H__3BF581A8_056E_40BC_99F7_271283243DD7__INCLUDED_

#include "../Common/CommonDef.h"
#include "../Common/MaskEdit.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SystemConfig.h : header file
//

typedef struct _tagUserInfo
{
	CString strUserName;
	CString strRealName;
	CString strPassword;
}USERINFO;

typedef struct _tagWAInfo
{
	int			nWAIndex;
	CString		strDevID;
}WAINFO;

/////////////////////////////////////////////////////////////////////////////
// CSystemConfig dialog

class CSystemConfig : public CDialog
{
// Construction
public:
	CSystemConfig(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CSystemConfig)
	enum { IDD = IDD_DIALOG_SYSTEM_CONFIG };
	CMaskEdit	m_edtDownTime;
	CMaskEdit	m_edtUpTime;
	CString	m_strSetOldPwd;
	CString	m_strSetNewPwd;
	CString	m_strSetNewConfirm;
	CString m_strNewUserName;
	CString m_strNewPassword;
	CString m_strNewPasswordConfirm;
	CString	m_strNewRealName;
	//}}AFX_DATA

	virtual void OnOK();
	virtual void OnCancel();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSystemConfig)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CSystemConfig)
	afx_msg void OnButtonSysReturn();
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonSetPassword();
	afx_msg void OnButtonNewUser();
	afx_msg void OnButtonWriteWAParam();
	afx_msg void OnButtonSaveHistoryData();
	afx_msg void OnCheck1();
	afx_msg void OnCheck2();
	afx_msg void OnCheck3();
	afx_msg void OnCheck4();
	afx_msg void OnCheck5();
	afx_msg void OnSelchangeComboSysUsers();
	afx_msg void OnSelchangeWAList();
	afx_msg void OnButtonDataBackup();
	afx_msg void OnButtonSysUpgrade();
	afx_msg void OnSelchangeComboWadevicesTime();
	afx_msg void OnButtonWriteWaTime();
	afx_msg void OnButtonSetHospitalName();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	void						InitWAColorIndex();
	void						InitWAParamCombo();
	void						ReadHospitalName();
	void						ReadUserInfo();
	void						SetEditLimit();
	void						ShowSaveDataWAList();
	void						ShowListToSetParam();
	
	void						ShowWABattery(int nGroup, DWORD dwBattery);

	void						EnableSetPassword();
	void						DisableBackup();
	void						DisableSystemUpgrade();
	void						DisableSetPassword();
	void						DisableNewUser();
	void						DisableSaveWAData();
	void						DisableSetWAParam();
	void						DisableSetWAParam4Time();
	void						DisableSetHospitalName();

private:
	std::vector<USERINFO>		m_vecUserInfo;
	std::vector<WAINFO>			m_vecWAInfo;
	std::vector<WAINFO>			m_vecWAInfo4Time;
	BOOL						m_bVersionUpgraded;

	CString						m_strComputerNo;
	CString						m_strHospitalName;

	int							m_nCurrentWA;
	int							m_nCurrentWA4Time;

	WA_BASIC_PARA				m_wbpCurWA;
	WA_BASIC_PARA				m_wbpCurWA4Time;
	
	CBrush						m_WAColor[MAX_SUPPORT_WA_COUNT];
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SYSTEMCONFIG_H__3BF581A8_056E_40BC_99F7_271283243DD7__INCLUDED_)
